package com.geostar.constructionland.analyse.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.geostar.constructionland.common.entity.logs.JsydFxrz;
import com.geostar.constructionland.common.entity.logs.JsydFxrzLs;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface FxrzLsMapper extends BaseMapper<JsydFxrzLs> {

    @Select(
            "  select *" +
                    "          from (select tt.ywid," +
                    "                 tt.fxlx," +
                    "                 tt.fxlx_mapped," +
                    "                 tt.error_msg," +
                    "                 tt.bz," +
                    "                 tt.fxsj," +
                    "                 tt.fxjg," +
                    "                 tt.fxbs," +
                    "                 tt.uniquetaskid," +
                    "                 t.mongo_id," +
                    "                 t.cost_time" +
                    "            from JSYD_FXRZ_LS tt" +
                    "            left join log_spt t" +
                    "              on tt.fxbs = t.fxbs" +
                    "              and tt.fxlx_mapped = t.fxlx) t" +
                    "         ${ew.customSqlSegment}"
    )
    List<JsydFxrzLs> getFxrzLsByYwid(@Param(Constants.WRAPPER) Wrapper<JsydFxrzLs> jsydFxrzWrapper);
}
